package com.rpc.framework;

import java.util.concurrent.CountDownLatch;

/**
 * Created by tan on 2017/8/25.
 */
public class ResponseFuture {
	private Response response;
	private CountDownLatch countDownLatch = new CountDownLatch(1);

	public void setResponse(Response response) {
		this.response = response;
		countDownLatch.countDown();

	}

	public Response get() throws InterruptedException {
		countDownLatch.await();
		return response;
	}
}
